package com.quick.exception;


import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum QuickStateEnum {
	TOKEN_FAILURE(20001,20001,"Token失效"),
	LOGIN_FAIL(20002,20002,"登录失败"),
	TOKEN_NOT_NULL(20003,20003,"Token不能为空"),
	USER_LOGIN_INVALID(20004,20004,"登录失效"),
	USER_ALREADY_EXISTS(20005,20005,"用户已存在"),
	ADMINISTRATOR_NOT_DELETE(20006,20006,"系统管理员不可删除"),
	CURRENT_USER_NOT_ROLE(20007,20006,"当前用户没有分配角色");
	private Integer code;
	private Integer languageCode;
	private String msg;
	
	public static QuickStateEnum getCode(Integer code) {
        for (QuickStateEnum  orderStatusEnum: QuickStateEnum.values()) {
            if(orderStatusEnum.getCode().equals(code)){
                return orderStatusEnum;
            }
        }
        return null;
    }
}
